<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../vue.js"></script>
    <script src="../vue-min.js"></script>
    <title>Document</title>
</head>

<body>
    <div id="app">
        <table>
            <thead>
                <th>索引</th>
                <th>ID:</th>
                <th>姓名:</th>
            </thead>
            <tbody>
                <!-- 
                    <!-官方建议：只要用到了v-for指令，那么一定要绑定一个：ky属性-> <!-而且，尽量把id作为key的值->
                 -->
                 <!-- :title="item.name + index" -->
                <tr v-for="(item,index) in list" ::key="item.id" >
                    <td>{{index}}</td>
                    <td>{{item.id}}</td>
                    <td>{{item.name}}</td>

                </tr>
            </tbody>
        </table>
    </div>
    <script>
        const vr = new Vue({
            el: "#app", //表示当前的vr属性要控制的类名
            data: {
                list:[
                    { id: 1, name:"zhangsan"},
                    { id: 2, name: "zhang" },
                    { id: 3, name: "zhangs" }
                ]
            }

        })
    </script>
</body>

</html>